package top.zywork.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.zywork.dos.GoodsOrderItemDO;

import java.util.List;

/**
 * GoodsSkuDAO数据访问接口<br/>
 *
 * 创建于2019-07-04<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Repository
public interface GoodsSkuDAO extends BaseDAO {

    @Override
    List<Object> listAllByCondition(@Param("query") Object queryObj);

    @Override
    List<Object> listPageByCondition(@Param("query") Object queryObj);

    @Override
    Long countByCondition(@Param("query") Object queryObj);

    /**
     * 保存订单时更新库存
     * @param goodsOrderItemDO
     * @return
     */
    int updateStock(GoodsOrderItemDO goodsOrderItemDO);

    /**
     * 取消订单时批量更新SKU库存
     * @param goodsOrderItemDOList
     * @return
     */
    int updateStockBatch(List<GoodsOrderItemDO> goodsOrderItemDOList);
}
